<%--
  Created by IntelliJ IDEA.
  User: 86150
  Date: 2021/7/14
  Time: 16:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>编号记录查询</title>
    <!-- CSS -->
    <link rel="stylesheet" href="${mybasePath}assets/bootstrap/css/bootstrap.min.css">
    <jsp:include page="../include/headtag.jsp" />
    <!-- <link rel="stylesheet"
        href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500"> -->
    <link rel="stylesheet"
          href="assets/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="assets/css/form-elements.css">
    <link rel="stylesheet" href="assets/css/style.css">

</head>
<body>
<jsp:include page="../include/head.jsp" />
<jsp:include page="../include/menu.jsp" />
<div id="page-wrapper" style="margin-top: 50px;">
    <div id="page-inner">
        <div class="row">
            <div class="col-md-12">
                <div class="text-left">
                    <a href="/index">首页</a>&nbsp;&gt;&nbsp;<a href="/codeSearchIndex" class="acts CurrChnlCls">编码查询</a> &gt; <a href="/codeSearch" class="acts CurrChnlCls">编号查询</a>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <h3 class="text-left">功能列表</h3>
                <div class="col-md-12">
                    <div class="nav navbar-nav navbar-right">
                        <a href="">查看全部功能</a>
                    </div>
                </div>
            </div>
        </div>
        <hr />
        <br />
        <div class="container-fluid">
            <form  action="/inputKey" class="col-sm-12 select-info table-bordered" method="post">
                <table class="table-bordered">
                    <br />
                    <tr>
                        <div class="row">
                            <div class="form-horizontal">
                                <div class="col-md-4">
                                    <input id="code_number" type="text" class="form-control"  value="${code_number_result}" placeholder="请填写您要搜索的编码编号" name="code_number" >
                                </div>
                                <div class="col-md-1">
                                    <button  value="search" type="submit" name="sousuo" onclick="isExist()">搜索</button>
                                </div>
                                <div class="col-md-1">
                                    <button  type="button" value="search_delete"  name="sousuo" onclick="re()">重置</button>
                                </div>
                            </div>
                        </div>
                    </tr>
                    <br />
                </table>
            </form>

        </div>
        <div class="container-fluid">
            <form  class="col-sm-12 select-info table-bordered" method="post">
                <table class="table table-striped table-hover ">
                    <thead>
                    <tr>
                        <th style="text-align: center;">编号</th>
                        <th style="text-align: center;">规则库编号</th>
                        <th style="text-align: center;">类别编号</th>
                        <th style="text-align: center;">规则编号</th>
                        <th style="text-align: center;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="Number" items="${codenumberresult }" varStatus="s">
                        <tr>
                            <td style="text-align: center;">${Number.codeNumber}</td>
                            <td style="text-align: center;">${Number.categoryId }</td>
                            <td style="text-align: center;">${Number.ruleCategoryId}</td>
                            <td style="text-align: center;">${Number.codeRuleId}</td>
                            <c:choose>
                                <c:when test="${Number.ruleCategoryId==9}">
                                    <td style="text-align: center;">
                                        <a onclick="redir_to_toppp(${Number.codeNumberId})"  class="btn btn-primary btn-sm">查看详细信息</a>
                                    </td>
                                </c:when>
                                <c:otherwise>
                                    <td style="text-align: center;">
                                        <a onclick="redir_to_topp(${Number.codeNumberId})"  class="btn btn-primary btn-sm">查看详细信息</a>
                                    </td>
                                </c:otherwise>
                            </c:choose>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </form>

        </div>

    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. PAGE WRAPPER  -->

</body>
<!-- Javascript -->
<script src="${mybasePath}assets/bootstrap/js/bootstrap.min.js"></script>
<script src="${mybasePath}assets/bootstrap/js/jquery.min.js"></script>
<script src="${mybasePath}assets/js/jquery.backstretch.min.js"></script>
<script type="text/javascript">
    function tijiao(url) {
        $("#setchInfo")
            .attr("action", "<c:url value='/noticeIndex/"+url+"' />");
        $("#setchInfo").submit();
        return false;
    }
</script>
<script type="text/javascript">
    function tijiaoInput() {
        var url = $("#tijiaoInput").val();
        if (url == "") {
            alert("请输入翻页数目");
            $("#tijiaoInput").attr("value", "");
            return false;
        } else {
            var match = /^[1-9][0-9]*[0-9]*$/;
            if (!match.test(url)) {
                $("#tijiaoInput").val("");
                alert("请正确填写翻页数目");

                return false;
            }
        }
        $("#setchInfo")
            .attr("action", "<c:url value='/noticeIndex/"+url+"' />");
        $("#setchInfo").submit();
        return false;
    }
</script>

<script type="text/javascript">
    function redir_to_topp(id) {
        window.location.href = "/codeSearchApply?id="+id;
    }
    function redir_to_toppp(id) {
        window.location.href = "/workflow?id="+id;
    }
    function isExist() {
        var titleVal = $("input[name=code_number]").val();
        if(titleVal=="" || titleVal==null)
        {
            alert("查询标识为空，请输入！");
        }
            return;
        }

    function re() {
        window.location.href="/codeSearch";
    }

    $(document).ready(function (){
        var errorString="${error}";
        if(errorString!="")
        { alert(errorString);}
    })
</script>
</html>
